<?php include TMPL_PATH.'public/header.phtml';?>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/jscal2.css"/>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/border-radius.css"/>
<link rel="stylesheet" type="text/css" href="/statics/js/calendar/win2k.css"/>
<script type="text/javascript" src="/statics/js/calendar/calendar.js"></script>
<script type="text/javascript" src="/statics/js/calendar/lang/zh-cn.js"></script>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
    	<div style="float:left;margin-right:50px;">
        <a href='javascript:;' class="on"><em>评论列表</em></a>
      </div>
    	<div style="color:#000;">
    		<form name="searchform" action="__SELF__"  method="post">
    		<input type="hidden" value="1" name="search">
				评论人 <input type="text" class="input-text" name="username">&nbsp;&nbsp;&nbsp;
				评论商品 <input type="text" class="input-text" name="product_name">&nbsp;&nbsp;&nbsp;
				开始时间 <input type="text" class="input-text" name="start_time" id="start_time">&nbsp;&nbsp;&nbsp;
				<script type="text/javascript">
			Calendar.setup({
			weekNumbers: false,
		    inputField : "start_time",
		    trigger    : "start_time",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script>
				截止时间 <input type="text" class="input-text" name="end_time" id="end_time">
				<script type="text/javascript">
			Calendar.setup({
			weekNumbers: false,
		    inputField : "end_time",
		    trigger    : "end_time",
		    dateFormat: "%Y-%m-%d",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script>
				<input type="submit" value="搜索" class="button" name="search">
    		</form>
    	</div>
    </div>
</div>
<div class="bk"></div>
<div class="pad_10">
<div class="table-list">
<form action="<?php echo U('comment/comment_delete');?>" method="post">
    <table width="100%" cellspacing="0" >
        <thead>
            <tr>
            <th width="38">选择</th>
            <th align='center' width="100">评论人</th>
            <th align='left'>评价商品</th>
            <th align='center' width="150">评价时间</th>
            <th align='center' width="80">状态</th>
						<th>管理操作</th>
            </tr>
        </thead>
    <tbody>
    <?php 
   	if(isset($shaidanList) && $shaidanList):
   		foreach ($shaidanList as $v):
   ?>
			<tr>
					<td align='center'><input name="ids[]" type="checkbox" value="<?php echo $v['id']?>" /></td>
					<td align='center'><?php echo $v['username']?></td>
					<td><?php echo $v['product_name']?></td>
					<td align='center'><?php echo date('Y-m-d H:i:s', $v['time']);?></td>
					<td align='center' id="status-<?php echo $v['id']?>">
					<?php if($v['disabled']):?>
					<a href="javascript:setting_status(<?php echo $v['id']?>,0);"><font color="red">√</font></a>
					<?php else:?>
					<a href="javascript:setting_status(<?php echo $v['id']?>,1);"><font color="blue">×</font></a>
					<?php endif;?>
					</td>
					<td align='center'> 
					<a href="javascript:shaidan_look(<?php echo $v['id'];?>);">查看</a> |
					<a href="javascript:confirmurl('<?php echo U('comment/shaidan_delete', 'comid='.$v['id']);?>','确认要删除该晒单吗？')">删除</a>
					</td>
				</tr>
	<?php 
		endforeach;
		endif;
	?>
   </tbody>
    </table>
   <div class="btn"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');">全选/取消 <input type="submit" class="button" name="dosubmit" value="删除"/></div>
</form>
<div id="pages"><?php echo $pageShow;?></div>
</div>
</div>
</body>
</html>
<script type="text/javascript">
<!--
function setting_status(id,disabled){
	$.get('<?php echo U('comment/change_shaidan_status_ajax');?>&comid='+id+'&disabled='+disabled,function(){
			if(disabled==0){
				$('#status-'+id).html('<a href="javascript:setting_status('+id+',1);"><font color="blue">×</font></a>');
			}else{
				$('#status-'+id).html('<a href="javascript:setting_status('+id+',0);"><font color="red">√</font></a>');
			}
		});
}
function shaidan_look(id){
	window.top.art.dialog({title:'查看晒单', id:'comment', iframe:'<?php echo U('comment/shaidan_info');?>&comid='+id ,width:'600px',height:'400px'},function(){window.top.art.dialog({id:'comment'}).close()});
}
//-->
</script>